package chapter03;

/**
 * 使用选择排序
 * Created by a on 2017/6/9.
 */
public class Test050 {
    public static void main(String[] args) {
        int[] ints = {63,4,24,1,3,15};
        int index;
        for (int i = 1;i<ints.length;i++){
            index = 0;
            for (int j=1;j<=ints.length-i;j++){
                if (ints[j-1]>ints[index]){
                    index=j;
                }
            }
            int temp = ints[ints.length-1];
            ints[ints.length-1] = ints[index];
            ints[index] = temp;
        }
        for (int i : ints){
            System.out.println(i);
        }
    }
}
